package com.oa.srms.apps.business.student.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import com.oa.srms.apps.business.student.IMajorInfoService;
import com.oa.srms.apps.dao.student.IMajorInfoDao;
import com.oa.srms.apps.entity.student.MajorInfoValue;

public class MajorInfoServiceImpl implements IMajorInfoService {
//	@Autowired
//	private MajorInfoValue majorInfoValue;
	
	@Autowired
	private IMajorInfoDao majorInfoDao;

//	@Override
//	public Integer addMajorInfo(String majorName, Double price)
//			throws Exception {
//		majorInfoValue.setMajorName(majorName);
//		majorInfoValue.setPrice(price);
//		majorInfoValue.setStates(IDEDStates.ENABLE);
//		return majorInfoDao.addMajorInfo(majorInfoValue);
//	}
//
//	@Override
//	public void modifyMajorInfo(Integer majorId, String majorName, Double price)
//			throws Exception {
//		majorInfoValue = this.queryByMajorId(majorId);
//		if(majorInfoValue!=null){
//			majorInfoValue.setMajorName(majorName);
//			majorInfoValue.setPrice(price);
//			majorInfoValue.setStates(IDEDStates.ENABLE);
//			majorInfoDao.editMajorInfo(majorInfoValue);
//		}
//
//	}
//
//	@Override
//	public void deleteMajorInfo(Integer majorId, String majorName, Double price)
//			throws Exception {
//		majorInfoValue=majorInfoDao.queryByMajorId(majorId);
//		majorInfoValue.setStates(IDEDStates.DELETE);
//		majorInfoDao.editMajorInfo(majorInfoValue);
//	}

	@Override
	public MajorInfoValue queryByMajorId(Integer majorId) throws Exception {
		return majorInfoDao.queryByMajorId(majorId);
	}

	@Override
	public List<MajorInfoValue> queryMajorInfo(Integer states) throws Exception {
		return majorInfoDao.queryMajorInfo(states);
	}

}
